package com.monkeyk.os.domain.users;

import com.monkeyk.os.domain.oauth.AccessToken;
import com.monkeyk.os.domain.shared.Repository;
import com.monkeyk.os.service.dto.UsersFormDto;

import java.util.List;

/**
 * 2016/6/3
 *
 * @author Shengzhao Li
 */

public interface UsersAuthzRepository extends UsersRepository {

    List<Users> findUsersByUsername(String username);

    List<Roles> findAvailableRolesList();

    Users findByUsername(String username);

    AccessToken queryByTokenId(String token_id);

    void updateUserLogin(final String user, final String state);
    void updatePhone(final String guid, final String phone);
    void updateAccessPhone(final String tokenId, final String username);
    void updateUser(Users user);
    Users findUserState(String id);

    String saveUsers(Users users);

    Roles findRolesByGuid(String guid);

    void insertUserRoles(String userId, int rolesId);
}